package org.teamh.logic.lobby;

import java.util.LinkedList;
import org.teamh.game.Start;

public class ModelManager {

	private Start start;
	private LinkedList<Game> games = null;
	private LinkedList<Player> players = null;
	private LinkedList<Map> maps = null;
	private String playerName;
	private String team;
	private String gameName;
	private boolean view;
	private boolean managerReady;
	private int count;
	
	public ModelManager(Start start) {
		this.setStart(start);
		this.games = new LinkedList<Game>();
		this.players = new LinkedList<Player>();	
		this.maps = new LinkedList<Map>();
	}

	public LinkedList<Game> getGames() {
		return games;
	}

	public LinkedList<Player> getPlayers() {
		return players;
	}

	public void setGames(LinkedList<Game> games) {
		this.games = games;
	}

	public void setPlayers(LinkedList<Player> players) {
		this.players = players;
	}
	
	public void addGame(Game game) {
		if (!games.contains(game)) {
			games.add(game);
		}
	}
	
	public void addPlayer(Player player) {
		if (!players.contains(player)) {
			players.add(player);
		}
	}
	
	public String getPlayerName() {
		return playerName;
	}

	public void setPlayerName(String playerName) {
		this.playerName = playerName;
	}

	public String getTeam() {
		return team;
	}

	public void setTeam(String team) {
		this.team = team;
	}

	public LinkedList<Map> getMaps() {
		return maps;
	}

	public void setMaps(LinkedList<Map> maps) {
		this.maps = maps;
	}

	public void addMap(Map map) {
		if(!maps.contains(map)) {
			maps.add(map);
		}
	}

	public Start getStart() {
		return start;
	}

	public void setStart(Start start) {
		this.start = start;
	}
	
	public boolean isManagerReady() {
		return managerReady;
	}
	
	public void setManagerReady(boolean managerReady) {
		System.out.println("set manager ready: " + managerReady);
		this.managerReady = managerReady;
	}

	public String getGameName() {
		return gameName;
	}

	public void setGameName(String gameName) {
		this.gameName = gameName;
	}

	public boolean getView() {
		return view;
	}

	public void setView(boolean view) {
		this.view = view;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public int getCount() {
		return count;
	}
}
